package com.wtzz.police.base.model.response;

import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.domain.Page;

import java.util.List;

@NoArgsConstructor
@Data
public class PageWapper<T> {

    public PageWapper(Page<T> page) {
        this.totalCount = page.getTotalElements();
        this.pageNum = page.getNumber() + 1;
        this.pageSize = page.getSize();
        this.totalPage = page.getTotalPages();
        this.list = page.getContent();
    }

    private long totalCount;
    private long totalPage;
    private long pageNum;
    private long pageSize;
    private List<T> list;
}
